IF EXISTS (SELECT * FROM SYSOBJECTS WHERE name='fnEncriptarCampo' and XTYPE='FN')
BEGIN
	DROP FUNCTION [dbo].[fnEncriptarCampo]
END
GO
CREATE FUNCTION fnEncriptarCampo
(
	@Campo VARCHAR(MAX)
)
RETURNS VARCHAR(MAX)
WITH ENCRYPTION
AS
BEGIN
	RETURN ENCRYPTBYPASSPHRASE('C0T3CM4R','PaSsWoRd==>>'+@Campo)
END
GO

